package com.larly.model.enums.notes;

import lombok.Getter;

@Getter
public enum NotesIsPublic {
    PRIVATE(0, "私密"),
    PUBLIC(1, "公开");


    private Integer key;
    private String value;

    NotesIsPublic(Integer key, String value) {
        this.key = key;
        this.value = value;
    }

    public static NotesIsPublic getByKey(Integer key) {
        for (NotesIsPublic item : NotesIsPublic.values()) {
            if (item.getKey().equals(key)) {
                return item;
            }
        }
        return null;
    }
}
